// 配置路由的地方
import Vue from 'vue';
import VueRouter from "vue-router";
// 使用插件
Vue.use(VueRouter);

// 引入路由组件
import Home from '@/pages/Home'
import Login from '@/pages/Login'
import Register from '@/pages/Register'
import Search from '@/pages/Search'

//配置路由
export default new VueRouter({
    // 配置路由
    routes: [
        {
            path: '/home',
            component: Home,
            meta: {show: true}
        },
        {
            path: '/login',
            component: Login,
            meta: {show: false}
        },
        {
            path: '/register',
            component: Register,
            meta: {show: false}
        },
        {
            path: '/search/:keyword?',
            name: 'search',
            component: Search,
            meta: {show: true}
        },
        {
            path: '/*',
            component: Home,
            meta: {show: true}
        },
    ]
})
